<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>联系人</title>
    <style>
        a {
            display: inline-block;
            width: 80px;
            height: 24px;
            background-color: red;
            color: white;
            text-decoration: none;
            text-align: center;
        }
    </style>
</head>
<body>
{% if contact %}
    {% load static %}
<!--    {{ contact.id }}-->
    {% if contact.gender == '男' %}
        <img src="{% static 'images/male.jpeg' %}" alt="gender">
    {% else %}
        <img src="{% static 'images/female.jpeg' %}" alt="gender">
    {% endif %}
    <h3>{{ contact.name}}</h3>
    <p>电话：{{ contact.phone }}</p>
    <a href="{% url 'contact:edit_info' contact.id %}">编辑</a>
    <a href="{% url 'contact:delete_contact' contact.id %}">删除</a>
{% else %}
    <p>查无此人</p>
{% endif %}
<a href="{% url 'contact:index' %}">返回</a>
</body>
</html>